﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSDS.Core.Model.Services.Geocoding
{
    public enum GEOCONFIDENCE { BadRequest, Low, Medium, High, Manual }; // Order is important.

    public class GeoCoordinate
    {
        // public string address;
        // public double lat;
        // public double lon;
        public string lat; // lat,lon values are stored as strings internally, so it's easier to keep as a string (See BsdsData.cs).
        public string lon;
    };

    public class GeoConfidenceCoordinate : GeoCoordinate
    {
        // public string address;
        public GEOCONFIDENCE ? confidence;

        public static GEOCONFIDENCE ? ConvertToGeoconfidence(string Confidence)
        {
            GEOCONFIDENCE ? con;

            switch (Confidence)
            {
                case "Manual"    : con = GEOCONFIDENCE.Manual; break;
                case "High"      : con = GEOCONFIDENCE.High; break;
                case "Medium"    : con = GEOCONFIDENCE.Medium; break;
                case "Low"       : con = GEOCONFIDENCE.Low; break;
                case "BadRequest": con = GEOCONFIDENCE.BadRequest; break;
                default          : con = null; break;
            }

            return con;
        }

        public override string ToString()
        {
            if (confidence == null)
            {
                return string.Empty;
            }
            else
            {
                return confidence.ToString();
            }
        }
    };
}
